visibleId: 0,
emptyChangedId: 0,
canClearChangedId: 0,
- keyFocusId: 0
+ messageFocusedId: 0
};
obj.destroyId = section.actor.connect('destroy', () => {
this._removeSection(section);
this._sync.bind(this));
obj.canClearChangedId = section.connect('can-clear-changed',
this._sync.bind(this));
- obj.keyFocusId = section.connect('key-focus-in',
- this._onKeyFocusIn.bind(this));
+ obj.messageFocusedId = section.connect('message-focused',
+ this._onMessageFocused.bind(this));
this._sections.set(section, obj);
this._sectionList.add_actor(section.actor);
section.actor.disconnect(obj.visibleId);
section.disconnect(obj.emptyChangedId);
section.disconnect(obj.canClearChangedId);
- section.disconnect(obj.keyFocusId);
+ section.disconnect(obj.messageFocusedId);
this._sections.delete(section);
this._sectionList.remove_actor(section.actor);
this._sync();
}
- _onKeyFocusIn(section, actor) {
- Util.ensureActorVisibleInScrollView(this._scrollView, actor);
+ _onMessageFocused(_section, messageActor) {
+ Util.ensureActorVisibleInScrollView(this._scrollView, messageActor);
}
_sync() {
key.keyButton.add_style_class_name('default-key');
key.keyButton.add_style_class_name('hide-key');
key.connect('released', () => {
- this.emit('hide');
+ this.emit('close-request');
});
row.appendKey(key.actor);
row.layoutButtons();
return;
if (focused)
- this.show(Main.layoutManager.focusIndex);
+ this.open(Main.layoutManager.focusIndex);
else
- this.hide();
+ this.close();
});
Meta.get_backend().connect('last-device-changed',
this._emojiSelection = new EmojiSelection();
this._emojiSelection.connect('toggle', this._toggleEmoji.bind(this));
- this._emojiSelection.connect('hide', () => this.hide());
+ this._emojiSelection.connect('close-request', () => this.close());
this._emojiSelection.connect('emoji-selected', (selection, emoji) => {
this._keyboardController.commitString(emoji);
});
return;
if (!(focus instanceof Clutter.Text)) {
- this.hide();
+ this.close();
return;
}
if (!this._showIdleId) {
this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
- this.show(Main.layoutManager.focusIndex);
+ this.open(Main.layoutManager.focusIndex);
this._showIdleId = 0;
return GLib.SOURCE_REMOVE;
});
if (keyval != null)
this._keyboardController.keyvalRelease(keyval);
else if (action == 'hide')
- this.hide();
+ this.close();
else if (action == 'languageMenu')
this._popupLanguageMenu(actor);
else if (action == 'emoji')
return;
if (enabled)
- this.show(Main.layoutManager.focusIndex);
+ this.open(Main.layoutManager.focusIndex);
else
- this.hide();
+ this.close();
}
_setActiveLayer(activeLevel) {
this._keyboardRestingId = 0;
}
- show(monitor) {
+ open(monitor) {
if (!this._enabled)
return;
KEYBOARD_REST_TIME,
() => {
this._clearKeyboardRestTimer();
- this._show(monitor);
+ this._open(monitor);
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
}
- _show(monitor) {
+ _open(monitor) {
if (!this._keyboardRequested)
return;
}
}
- hide() {
+ close() {
if (!this._enabled)
return;
KEYBOARD_REST_TIME,
() => {
this._clearKeyboardRestTimer();
- this._hide();
+ this._close();
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
}
- _hide() {
+ _close() {
if (this._keyboardRequested)
return;
radialEffect: false,
});
+ this._active = false;
this._container = container;
this._children = container.get_children();
this._fadeFactor = params.fadeFactor;
container.add_actor(this.actor);
this.actor.raise_top();
this.actor.hide();
- this.shown = false;
this.actor.connect('destroy', this._onDestroy.bind(this));
this._highlighted = null;
}
+ get active() {
+ return this._active;
+ }
+
_actorAdded(container, newChild) {
let children = this._container.get_children();
let myIndex = children.indexOf(this.actor);
}
}
- show(fadeInTime) {
+ lightOn(fadeInTime) {
this.actor.remove_all_transitions();
let easeProps = {
};
let onComplete = () => {
- this.shown = true;
- this.emit('shown');
+ this._active = true;
+ this.emit('active-changed');
};
this.actor.show();
}
}
- hide(fadeOutTime) {
- this.shown = false;
+ lightOff(fadeOutTime) {
this.actor.remove_all_transitions();
+ this._active = false;
+ this.emit('active-changed');
+
let easeProps = {
duration: fadeOutTime || 0,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
this._sync();
}
- _onKeyFocusIn(actor) {
- this.emit('key-focus-in', actor);
+ _onKeyFocusIn(messageActor) {
+ this.emit('message-focused', messageActor);
}
get allowed() {
this.dialogLayout.opacity = 255;
if (this._lightbox)
- this._lightbox.show();
+ this._lightbox.lightOn();
this.opacity = 0;
this.show();
this.ease({
this._longLightbox = new Lightbox.Lightbox(Main.uiGroup,
{ inhibitEvents: true,
fadeFactor: 1 });
- this._longLightbox.connect('shown', this._onLongLightboxShown.bind(this));
+ this._longLightbox.connect('active-changed', this._onLongLightbox.bind(this));
this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup,
{ inhibitEvents: true,
fadeFactor: 1 });
- this._shortLightbox.connect('shown', this._onShortLightboxShown.bind(this));
+ this._shortLightbox.connect('active-changed', this._onShortLightbox.bind(this));
this.idleMonitor = Meta.IdleMonitor.get_core();
this._cursorTracker = Meta.CursorTracker.get_for_display(global.display);
_activateFade(lightbox, time) {
Main.uiGroup.set_child_above_sibling(lightbox.actor, null);
- lightbox.show(time);
+ lightbox.lightOn(time);
if (this._becameActiveId == 0)
this._becameActiveId = this.idleMonitor.add_user_active_watch(this._onUserBecameActive.bind(this));
this._becameActiveId = 0;
if (this._isActive || this._isLocked) {
- this._longLightbox.hide();
- this._shortLightbox.hide();
+ this._longLightbox.lightOff();
+ this._shortLightbox.lightOff();
} else {
this.deactivate(false);
}
}
- _onLongLightboxShown() {
- this.activate(false);
+ _onLongLightbox(lightBox) {
+ if (lightBox.active)
+ this.activate(false);
}
- _onShortLightboxShown() {
- this._completeLockScreenShown();
+ _onShortLightbox(lightBox) {
+ if (lightBox.active)
+ this._completeLockScreenShown();
}
showDialog() {
this._dialog = null;
}
- this._longLightbox.hide();
- this._shortLightbox.hide();
+ this._longLightbox.lightOff();
+ this._shortLightbox.lightOff();
this.actor.hide();
if (this._becameActiveId != 0) {
this._resultsView = resultsView;
this._terms = [];
+ this._focusChild = null;
this.actor = new St.BoxLayout({ style_class: 'search-section',
vertical: true });
this.actor.hide();
}
+ get focusChild() {
+ return this._focusChild;
+ }
+
_keyFocusIn(actor) {
- this.emit('key-focus-in', actor);
+ if (this._focusChild == actor)
+ return;
+ this._focusChild = actor;
+ this.emit('focus-child-changed');
}
_setMoreCount(_count) {
return false;
}
- _keyFocusIn(provider, actor) {
- Util.ensureActorVisibleInScrollView(this._scrollView, actor);
+ _focusChildChanged(provider) {
+ Util.ensureActorVisibleInScrollView(this._scrollView, provider.focusChild);
}
_ensureProviderDisplay(provider) {
else
providerDisplay = new GridSearchResults(provider, this);
- providerDisplay.connect('key-focus-in', this._keyFocusIn.bind(this));
+ providerDisplay.connect('focus-child-changed', this._focusChildChanged.bind(this));
providerDisplay.actor.hide();
this._content.add(providerDisplay.actor);
provider.display = providerDisplay;
this._showing = false;
}
- show(window, tileRect, monitorIndex) {
+ open(window, tileRect, monitorIndex) {
let windowActor = window.get_compositor_private();
if (!windowActor)
return;
});
}
- hide() {
+ close() {
if (!this._showing)
return;
let mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN;
let bottomDragAction = new EdgeDragAction.EdgeDragAction(St.Side.BOTTOM, mode);
bottomDragAction.connect('activated', () => {
- Main.keyboard.show(Main.layoutManager.bottomIndex);
+ Main.keyboard.open(Main.layoutManager.bottomIndex);
});
Main.layoutManager.connect('keyboard-visible-changed', (manager, visible) => {
bottomDragAction.cancel();
_showTilePreview(shellwm, window, tileRect, monitorIndex) {
if (!this._tilePreview)
this._tilePreview = new TilePreview();
- this._tilePreview.show(window, tileRect, monitorIndex);
+ this._tilePreview.open(window, tileRect, monitorIndex);
}
_hideTilePreview() {
if (!this._tilePreview)
return;
- this._tilePreview.hide();
+ this._tilePreview.close();
}
_showWindowMenu(shellwm, window, menu, rect) {